//
//  UIBarButtonItem+Extension.swift
//  MicroBlog
//
//  Created by  NorthCity on 15/11/15.
//  Copyright © 2015年  NorthCity. All rights reserved.
//

import UIKit
extension UIBarButtonItem{
    /// 便利构造函数
    convenience init(imageName:String,target:AnyObject,actionName:String?) {
      
        let button = UIButton(imageName: imageName, backImageName: "")
        if let actionName = actionName{
            button.addTarget(target, action: Selector(actionName), forControlEvents: UIControlEvents.TouchUpInside)
        }
        self.init(customView:button)
    }
    
}